home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / libraries / mui20dev.lha / MUI / Developer / Autodocs / MUI_List.doc < prev    next >
Text File  |  1994-02-11  |  24KB  |  893 lines

  1. TABLE OF CONTENTS
  2.  
  3. List.mui/List.mui
  4. List.mui/MUIM_List_Clear
  5. List.mui/MUIM_List_Exchange
  6. List.mui/MUIM_List_GetEntry
  7. List.mui/MUIM_List_Insert
  8. List.mui/MUIM_List_InsertSingle
  9. List.mui/MUIM_List_Jump
  10. List.mui/MUIM_List_NextSelected
  11. List.mui/MUIM_List_Redraw
  12. List.mui/MUIM_List_Remove
  13. List.mui/MUIM_List_Select
  14. List.mui/MUIM_List_Sort
  15. List.mui/MUIA_List_Active
  16. List.mui/MUIA_List_AdjustHeight
  17. List.mui/MUIA_List_AdjustWidth
  18. List.mui/MUIA_List_CompareHook
  19. List.mui/MUIA_List_ConstructHook
  20. List.mui/MUIA_List_DestructHook
  21. List.mui/MUIA_List_DisplayHook
  22. List.mui/MUIA_List_Entries
  23. List.mui/MUIA_List_First
  24. List.mui/MUIA_List_Format
  25. List.mui/MUIA_List_MultiTestHook
  26. List.mui/MUIA_List_Quiet
  27. List.mui/MUIA_List_SourceArray
  28. List.mui/MUIA_List_Title
  29. List.mui/MUIA_List_Visible
  30. List.mui/List.mui
  31.  
  32.     MUI's list class is very powerful. It handles all types
  33.     of entries, from a simple string to a complicated structure
  34.     with many associated resources. Multi column lists are
  35.     also supported, the format for a column is adjustable.
  36.  
  37.     Lists support any kind of sorting, multi selection and
  38.     an active entry that can be controlled with the mouse
  39.     or the cursor keys.
  40.  
  41.     Note: A list object alone doesn't make much sense, you
  42.           should always use it as child of a listview object.
  43.           This one attaches a scrollbar and handles all user
  44.           input.
  45. List.mui/MUIM_List_Clear
  46.  
  47.     NAME
  48.     MUIM_List_Clear
  49.  
  50.     SYNOPSIS
  51.     DoMethod(obj,MUIM_List_Clear,);
  52.  
  53.     FUNCTION
  54.     Clear the list, all entries are removed. If a destruct
  55.     hook is set it will be called for every entry.
  56.  
  57.     SEE ALSO
  58.     MUIM_List_Insert, MUIA_List_DestructHook
  59. List.mui/MUIM_List_Exchange
  60.  
  61.     NAME
  62.     MUIM_List_Exchange
  63.  
  64.     SYNOPSIS
  65.     DoMethod(obj,MUIM_List_Exchange,LONG pos1, LONG pos2);
  66.  
  67.     FUNCTION
  68.     Exchange two entries in a list.
  69.  
  70.     INPUTS
  71.     pos1 - number of the first entry.
  72.     pos2 - number of the second entry.
  73.  
  74.     MUIV_List_Exchange_Active for pos1 or pos2 
  75.     addresses the currently active entry.
  76.  
  77.     SEE ALSO
  78.     MUIM_List_Insert, MUIA_List_Remove
  79. List.mui/MUIM_List_GetEntry
  80.  
  81.     NAME
  82.     MUIM_List_GetEntry
  83.  
  84.     SYNOPSIS
  85.     DoMethod(obj,MUIM_List_GetEntry,LONG pos, APTR *entry);
  86.  
  87.     FUNCTION
  88.     Get an entry of a list.
  89.  
  90.     INPUTS
  91.     pos   - Number of entry, MUIV_List_GetEntry_Active can
  92.             be used to get the active entry.
  93.  
  94.     entry - Pointer to a longword where the entry will
  95.             be stored. If the entry is not available
  96.             (either because you are out of bounds or
  97.             because there is no active entry), you will
  98.             receive a NULL.
  99.  
  100.     EXAMPLE
  101.     /* iterate through a list containing file info blocks */
  102.  
  103.     for (i=0;;i++)
  104.     {
  105.         struct FileInfoBlock *fib;
  106.  
  107.         DoMethod(list,MUIM_List_GetEntry,i,&fib);
  108.         if (!fib) break;
  109.  
  110.         printf("%s\n",fib->fib_FileName);
  111.     }
  112.  
  113.     SEE ALSO
  114.     MUIM_List_Insert, MUIM_List_Remove
  115. List.mui/MUIM_List_Insert
  116.  
  117.     NAME
  118.     MUIM_List_Insert
  119.  
  120.     SYNOPSIS
  121.     DoMethod(obj,MUIM_List_Insert,APTR *entries, LONG count, LONG pos);
  122.  
  123.     FUNCTION
  124.     Insert new entries into a list.
  125.     When the list has a construct hook, the given pointers
  126.     won't be inserted directly but instead passed through 
  127.     to the construct hook.
  128.  
  129.     INPUTS
  130.     entries - pointer to an array of pointers to be inserted.
  131.               Warning: This is a pointer to a pointer. See
  132.               example for details.
  133.  
  134.     count   - Number of elements to be inserted. If count==-1,
  135.               entries will be inserted until NULL pointer in
  136.               the entries array is found.
  137.  
  138.     pos     - New entries will be added in front of this entry.
  139.               MUIV_List_Insert_Top:
  140.                  insert as first entry.
  141.               MUIV_List_Insert_Active:
  142.                  insert in front of the active entry.
  143.               MUIV_List_Insert_Sorted:
  144.                  insert sorted.
  145.               MUIV_List_Insert_Bottom:
  146.                  insert as last entry.
  147.  
  148.     EXAMPLE
  149.     /* insert a string */
  150.     char *str = "New entry";
  151.     DoMethod(list,MUIM_List_Insert,&str,1,MUIV_List_Insert_Bottom);
  152.  
  153.     /* insert an array */
  154.     char *str[] =
  155.     {
  156.        "Entry 1",
  157.        "Entry 2",
  158.        "Entry 3",
  159.        "Entry 4",
  160.        NULL
  161.     };
  162.     DoMethod(list,MUIM_List_Insert,&str,-1,MUIV_List_Insert_Bottom);
  163.  
  164.     SEE ALSO
  165.     MUIM_List_Remove, MUIA_List_ConstructHook
  166. List.mui/MUIM_List_InsertSingle
  167.  
  168.     NAME
  169.     MUIM_List_InsertSingle
  170.  
  171.     SYNOPSIS
  172.     DoMethod(obj,MUIM_List_InsertSingle,APTR entry, LONG pos);
  173.  
  174.     FUNCTION
  175.     Insert one new entry into a list. Using MUIM_List_Insert has
  176.     caused some confusion since it takes an array to items instead
  177.     a single item. To insert single items, MUIM_List_InsertSingle
  178.     is the better choice.
  179.  
  180.     When the list has a construct hook, the given pointer
  181.     won't be inserted directly but instead passed through
  182.     to the construct hook.
  183.  
  184.     INPUTS
  185.     entry   - item to insert.
  186.  
  187.     pos     - New entry will be added in front of this entry.
  188.               MUIV_List_Insert_Top:
  189.                  insert as first entry.
  190.               MUIV_List_Insert_Active:
  191.                  insert in front of the active entry.
  192.               MUIV_List_Insert_Sorted:
  193.                  insert sorted.
  194.               MUIV_List_Insert_Bottom:
  195.                  insert as last entry.
  196.  
  197.     EXAMPLE
  198.     /* insert a string */
  199.     DoMethod(list,MUIM_List_InsertSingle,"foobar",MUIV_List_Insert_Bottom);
  200.  
  201.     SEE ALSO
  202.     MUIM_List_Remove, MUIA_List_ConstructHook, MUIM_List_InsertSingle
  203. List.mui/MUIM_List_Jump
  204.  
  205.     NAME
  206.     MUIM_List_Jump
  207.  
  208.     SYNOPSIS
  209.     DoMethod(obj,MUIM_List_Jump,LONG pos);
  210.  
  211.     FUNCTION
  212.     Scroll any entry into the visible part of a list.
  213.  
  214.     Note: Jumping to an entry doesn't mean to make this
  215.           entry the active one. This can be done by 
  216.           setting the MUIA_List_Active attribute.
  217.  
  218.     INPUTS
  219.     pos - Number of the entry that should be made visible.
  220.           Use MUIV_List_Jump_Active to jump to the active
  221.           entry.
  222.  
  223.     EXAMPLE
  224.     /* line 42 is interesting, so make it visible */
  225.     DoMethod(list,MUIM_List_Jump,42);
  226.  
  227.     SEE ALSO
  228.     MUIA_List_Active
  229. List.mui/MUIM_List_NextSelected
  230.  
  231.     NAME
  232.     MUIM_List_NextSelected
  233.  
  234.     SYNOPSIS
  235.     DoMethod(obj,MUIM_List_NextSelected,LONG *pos);
  236.  
  237.     FUNCTION
  238.     Iterate through the selected entries of a list.
  239.     This method steps through the contents of a (multi
  240.     select) list and returns every entry that is currently
  241.     selected. When no entry is selected but an entry is
  242.     active, only the active entry will be returned.
  243.  
  244.     This behaviour will result in not returning the
  245.     active entry when you have some other selected
  246.     entries somewhere in your list. Since the active
  247.     entry just acts as some kind of cursor mark,
  248.     this seems to be the only sensible possibility
  249.     to handle multi selection together with keyboard
  250.     control.
  251.  
  252.     INPUTS
  253.     pos - a pointer to longword that will hold the number
  254.           of the returned entry. Must be set to -1 at
  255.           start of iteration. Is set to -1 when iteration
  256.           is finished.
  257.  
  258.     EXAMPLE
  259.  
  260.     /* Iterate through a list with FileInfoBlocks */
  261.  
  262.     struct FileInfoBlock *fib;
  263.     LONG id = -1;
  264.  
  265.     for (;;)
  266.     {
  267.        DoMethod(list,MUIM_List_NextSelected,&id);
  268.        if (id==-1) break;
  269.  
  270.        DoMethod(list,MUIM_List_GetEntry,id,&fib);
  271.        printf("selected: %s\n",fib->fib_FileName);
  272.     }
  273.  
  274.  
  275.     SEE ALSO
  276.     MUIM_List_Select
  277. List.mui/MUIM_List_Redraw
  278.  
  279.     NAME
  280.     MUIM_List_Redraw
  281.  
  282.     SYNOPSIS
  283.     DoMethod(obj,MUIM_List_Redraw,LONG pos);
  284.  
  285.     FUNCTION
  286.     If you made some changes to an entry of your list and
  287.     want these changes to be shown in the display, you will
  288.     have to call this method.
  289.  
  290.     INPUTS
  291.     pos - Number of the line to redraw. When the line is not
  292.           currently visible, nothing will happen. Specials:
  293.           MUIV_List_Redraw_Active:
  294.              redraw the active line (if any),
  295.           MUIV_List_Redraw_All:
  296.              redraw all lines.
  297.  
  298.     EXAMPLE
  299.     /* do a complete refresh: */
  300.     DoMethod(list,MUIM_List_Redraw,MUIV_List_Redraw_All);
  301. List.mui/MUIM_List_Remove
  302.  
  303.     NAME
  304.     MUIM_List_Remove
  305.  
  306.     SYNOPSIS
  307.     DoMethod(obj,MUIM_List_Remove,LONG pos);
  308.  
  309.     FUNCTION
  310.     Remove an entry from a list.
  311.  
  312.     INPUTS
  313.     pos - number of the entry to be removed or one of
  314.           MUIV_List_Remove_First,
  315.           MUIV_List_Remove_Active,
  316.           MUIV_List_Remove_Last.
  317.           When the active entry is removed, the following entry
  318.           will become active.
  319.  
  320.     EXAMPLE
  321.     /* when delete is pressed, remove the active entry */
  322.     DoMethod(btdel,MUIM_Notify,MUIA_Pressed,FALSE,
  323.        list,2,MUIM_List_Remove,MUIV_List_Remove_Active);
  324.  
  325.     SEE ALSO
  326.     MUIM_List_Insert, MUIA_List_DestructHook
  327. List.mui/MUIM_List_Select
  328.  
  329.     NAME
  330.     MUIM_List_Select
  331.  
  332.     SYNOPSIS
  333.     DoMethod(obj,MUIM_List_Select,LONG pos, LONG seltype, LONG *state);
  334.  
  335.     FUNCTION
  336.     Select/deselect a list entry or ask an entry if its
  337.     selected.
  338.  
  339.     INPUTS
  340.  
  341.     pos     - Number of the entry or
  342.               MUIV_List_Select_Active for the active entry.
  343.               MUIV_List_Select_All    for all entries.
  344.  
  345.     seltype - MUIV_List_Select_Off     unselect entry.
  346.               MUIV_List_Select_On      select entry.
  347.               MUIV_List_Select_Toggle  toggle entry.
  348.               MUIV_List_Select_Ask     just ask about the state.
  349.  
  350.     state   - Pointer to a longword. If not NULL, this will
  351.               be filled with the current selection state.
  352.  
  353.     EXAMPLE
  354.     /* toggle selection state of active entry */
  355.     DoMethod(list,MUIM_List_Select,MUIV_List_Select_Active,
  356.        MUIV_List_Select_Toggle,NULL);
  357.  
  358.     /* select all entries */
  359.     DoMethod(list,MUIM_List_Select,MUIV_List_Select_All,
  360.        MUIV_List_Select_On,NULL);
  361.  
  362.     SEE ALSO
  363.     MUIA_List_MultiTest_Hook
  364. List.mui/MUIM_List_Sort
  365.  
  366.     NAME
  367.     MUIM_List_Sort
  368.  
  369.     SYNOPSIS
  370.     DoMethod(obj,MUIM_List_Sort,);
  371.  
  372.     FUNCTION
  373.     Sort the list. MUI uses an iterative quicksort algorithm,
  374.     no stack problems will occur.
  375.  
  376.     SEE ALSO
  377.     MUIA_List_CompareHook
  378. List.mui/MUIA_List_Active
  379.  
  380.     NAME
  381.     MUIA_List_Active -- [ISG], LONG
  382.  
  383.     SPECIAL INPUTS
  384.     MUIV_List_Active_Off
  385.     MUIV_List_Active_Top
  386.     MUIV_List_Active_Bottom
  387.     MUIV_List_Active_Up
  388.     MUIV_List_Active_Down
  389.     MUIV_List_Active_PageUp
  390.     MUIV_List_Active_PageDown
  391.  
  392.     FUNCTION
  393.     Reading this attribute will return the number of
  394.     the active entry (the one with the cursor on it).
  395.     The result is between 0 and MUIA_List_Entries-1
  396.     or MUIV_List_Active_Off, in which case there is
  397.     currently no active entry.
  398.  
  399.     Setting the attribute will cause the list to
  400.     move the cursor to the new position and scroll
  401.     this position into the visible area.
  402.  
  403.     SEE ALSO
  404.     MUIA_List_Entries, MUIA_List_First, MUIA_List_Visible
  405. List.mui/MUIA_List_AdjustHeight
  406.  
  407.     NAME
  408.     MUIA_List_AdjustHeight -- [I..], BOOL
  409.  
  410.     FUNCTION
  411.     A list with MUIA_List_AdjustHeight set to true is exactly
  412.     as high as all of its entries and not resizable. This is
  413.     only possible when the list is filled *before* the window
  414.     is opened.
  415.  
  416.     SEE ALSO
  417.     MUIA_List_AdjustWidth
  418. List.mui/MUIA_List_AdjustWidth
  419.  
  420.     NAME
  421.     MUIA_List_AdjustWidth -- [I..], BOOL
  422.  
  423.     FUNCTION
  424.     A list with MUIA_List_AdjustWidth set to true is exactly
  425.     as wide as the widest entry and not resizable. This is
  426.     only possible when the list is filled *before* the window
  427.     is opened.
  428.  
  429.     SEE ALSO
  430.     MUIA_List_AdjustHeight
  431. List.mui/MUIA_List_CompareHook
  432.  
  433.     NAME
  434.     MUIA_List_CompareHook -- [IS.], struct Hook *
  435.  
  436.     FUNCTION
  437.     If you plan to have the entries of your list sorted
  438.     (either by inserting them sorted or by using the
  439.     MUIM_List_Sort method) and if the entries of your
  440.     list are not simple strings, you *must* supply
  441.     a compare hook.
  442.  
  443.     This hook will be called with one list element in A1
  444.     and another one in A2. You should return
  445.  
  446.     -1   e1 <  e2
  447.      0   e1 == e2
  448.      1   e1 >  e2
  449.  
  450.     EXAMPLE
  451.     /* the builtin string compare function */
  452.  
  453.         LONG __asm cmpfunc(_a1 char *s1,_a2 char *s2)
  454.     {
  455.        return(stricmp(s1,s2));
  456.     }
  457.  
  458.     SEE ALSO
  459.     MUIA_List_ConstructHook, MUIA_List_DestructHook
  460. List.mui/MUIA_List_ConstructHook
  461.  
  462.     NAME
  463.     MUIA_List_ConstructHook -- [IS.], struct Hook *
  464.  
  465.     SPECIAL INPUTS
  466.     MUIV_List_ConstructHook_String
  467.  
  468.     FUNCTION
  469.     The construct hook is called whenever you add an
  470.     entry to your list. MUI will not insert the given
  471.     pointer directly, but instead call the construct
  472.     hook and add its result code.
  473.  
  474.     Imagine you want to display a list of entries
  475.     in a directory. You could step through it
  476.     using Examine()/ExNext() and directly use the
  477.     MUIM_List_Insert method on your file info block
  478.     buffer.
  479.  
  480.     Your construct hook will be called with this
  481.     file info block as parameter, makes a copy of
  482.     it and returns the address of that copy. Thats
  483.     what is actually added to the list.
  484.  
  485.     The corresponding destruct hook is called whenever
  486.     an entry shall be removed. It's task would simply be
  487.     to free the memory and maybe other resources concering
  488.     this entry that were allocated by the construct hook.
  489.  
  490.     Using these two functions, you will never have to
  491.     worry about freeing the memory used by your list
  492.     entries. Clearing the list or disposing the list
  493.     object will automatically remove all entries and
  494.     thus free the associated resources.
  495.  
  496.     The construct hook will be called with the hook
  497.     in A0, the data given to MUIM_List_Insert as message
  498.     in register A1 and with pointer to a standard kick 3.x
  499.     memory pool in A2. If you want, you can use the exec
  500.     or amiga.lib functions for allocating memory within
  501.     this pool, but this is only an option.
  502.  
  503.     If the construct hook returns NULL, nothing will be
  504.     added to the list.
  505.  
  506.     There is a builtin construct hook available called
  507.     MUIV_List_ConstructHook_String. This expects that
  508.     you only add strings to your list and will make
  509.     a local copy of this string to allow you destroying
  510.     the original. Of course you *must* also use
  511.     MUIV_List_DestructHook_String in this case.
  512.  
  513.     Without construct and destruct hooks, you are responsible
  514.     for allocating and freeing entries yourself.
  515.  
  516.     EXAMPLE
  517.     /* the builtin string construct and destruct functions: */
  518.  
  519.     APTR __asm consfunc(_a2 APTR pool,_a1 char *str)
  520.     {
  521.        char *new;
  522.        if (new=AllocPooled(pool,strlen(str)+1))
  523.           strcpy(new,str);
  524.        return(new);
  525.     }
  526.  
  527.     VOID __asm desfunc(_a2 APTR pool,_a1 char *entry)
  528.     {
  529.        FreePooled(pool,entry,strlen(entry)+1);
  530.     }
  531.  
  532.     /* for more sophisticated hooks see demo program WbMan.c */
  533.  
  534.     SEE ALSO
  535.     MUIA_List_DestructHook, MUIA_List_DisplayHook
  536. List.mui/MUIA_List_DestructHook
  537.  
  538.     NAME
  539.     MUIA_List_DestructHook -- [IS.], struct Hook *
  540.  
  541.     SPECIAL INPUTS
  542.     MUIV_List_DestructHook_String
  543.  
  544.     FUNCTION
  545.     Set up a destruct hook for your list. For detailed
  546.     explanation see MUIA_List_ConstructHook.
  547.  
  548.     SEE ALSO
  549.     MUIA_List_ConstructHook, MUIA_List_DisplayHook
  550. List.mui/MUIA_List_DisplayHook
  551.  
  552.     NAME
  553.     MUIA_List_DisplayHook -- [IS.], struct Hook *
  554.  
  555.     FUNCTION
  556.     Since MUI's lists can handle any kind of entries,
  557.     you have to supply a display hook to specify what
  558.     should actually be shown in the display.
  559.  
  560.     The hook will be called with a pointer to the
  561.     entry to be displayed in A1 and a pointer to
  562.     a string array containing as many entries as
  563.     your list may have columns in A2.
  564.  
  565.     You must fill this array with the strings that
  566.     you want to display.
  567.  
  568.     Note: You can of course use MUI's text engine
  569.           facilities here to create e.g. right aligned
  570.           or centered columns.
  571.  
  572.     Without a display hook, MUI expects a simple one
  573.     columned string list.
  574.  
  575.     See MUIA_List_Format for details about column handling.
  576.  
  577.     Note: Since version 6 of MUI, the display hook also gets the
  578.         position of the current entry as additional parameter. You
  579.     can easily do e.g. some line numbering using this feature. The
  580.     number (from 0 to NumEntries-1) is stored in the longword
  581.     *preceding* the column array (see example below).
  582.  
  583.     EXAMPLE
  584.     /* list of file info blocks, two columned, name and size */
  585.  
  586.     LONG __asm dispfunc(_a2 char **array,_a1 struct FileInfoBlock *fib)
  587.     {
  588.        static char buf1[20],buf2[20];
  589.  
  590.        if (fib->fib_EntryType<0)
  591.          sprintf(buf2,"\33r%ld",fib->fib_Size);
  592.        else
  593.          strcpy(buf2,"\33r(dir)");
  594.  
  595.        sprintf(buf1,"%ld",array[-1]);   // get the line number.
  596.  
  597.        *array++ = buf1;
  598.        *array++ = fib->fib_FileName;
  599.        *array   = buf2;
  600.  
  601.        return(0);
  602.     }
  603.  
  604.     SEE ALSO
  605.     MUIA_List_Format, MUIA_Text_Contents
  606. List.mui/MUIA_List_Entries
  607.  
  608.     NAME
  609.     MUIA_List_Entries -- [..G], LONG
  610.  
  611.     FUNCTION
  612.     Get the current number of entries in the list.
  613.  
  614.     SEE ALSO
  615.     MUIA_List_First, MUIA_List_Visible, MUIA_List_Active
  616. List.mui/MUIA_List_First
  617.  
  618.     NAME
  619.     MUIA_List_First -- [..G], LONG
  620.  
  621.     FUNCTION
  622.     Get the number of the entry displayed on top of
  623.     the list. You have to be prepared to get a result
  624.     of -1, which means that the list is not visible
  625.     at all (e.g. when the window is iconifed).
  626.  
  627.     SEE ALSO
  628.     MUIA_List_Visible, MUIA_List_Entries, MUIA_List_Active
  629. List.mui/MUIA_List_Format
  630.  
  631.     NAME
  632.     MUIA_List_Format -- [ISG], STRPTR
  633.  
  634.     FUNCTION
  635.     MUI has the ability to handle multi column lists. To define
  636.     how many columns should be displayed and how they should be
  637.     formatted, you specify a format string.
  638.  
  639.     This format string must contain one entry for each column
  640.     you want to see. Entries are seperated by commas, one
  641.     entry is parsed via dos.library/ReadArgs().
  642.  
  643.     The template for a single entry looks like this:
  644.  
  645.     DELTA=D/N,PREPARSE=P/K,WEIGHT=W/N,
  646.     MINWIDTH=MIW/N,MAXWIDTH=MAW/N,COL=C/N
  647.  
  648.     DELTA
  649.        Space in pixel between this column and the next.
  650.        the last displayed column ignores this setting.
  651.        Defaults to 4.
  652.  
  653.     PREPARSE
  654.        A preparse value for this column. Setting this
  655.        e.g. to "\33c" would make the column centered.
  656.        See MUIA_Text_Contents for other control codes.
  657.  
  658.     WEIGHT
  659.        The weight of the column. As with MUI's group
  660.        class, columns are layouted with a minimum
  661.        size, a maximum size and weight. A column with
  662.        a weight of 200 would gain twice the space than
  663.        a column with a weight of 100.
  664.        Defaults to 100.
  665.  
  666.     MINWIDTH
  667.        Minimum percentage width for the current column.
  668.        If your list is 200 pixel wide and you set this
  669.        to 25, your column will at least be 50 pixel.
  670.        The special value -1 for this parameter means that
  671.        the minimum width is as wide as the widest entry in
  672.        this column. This ensures that every entry will be
  673.        completely visible (as long as the list is wide enough).
  674.        Defaults to -1.
  675.  
  676.     MAXWIDTH
  677.        Maximum percentage width for the current column.
  678.        If your list is 200 pixel wide and you set this
  679.        to 25, your column will not be wider as 50 pixel.
  680.        The special value -1 for this parameter means that
  681.        the maximum width is as wide as the widest entry in
  682.        this column.
  683.        Defaults to -1.
  684.  
  685.     COL
  686.        This value adjusts the number of the current column.
  687.        This allows you to adjust the order of your columns
  688.        without having to change your display hook. See
  689.        example for details.
  690.        Defaults to current entry number (0,1,...)
  691.  
  692.     If your list object gets so small there is not enough
  693.     place for the minwidth of a column, this column will
  694.     be hidden completely and the remaining space is
  695.     distributed between the remaining columns. This is not
  696.     true if the column is the first column, in this case
  697.     the entries will simply be clipped.
  698.  
  699.     Note: You will have as many columns in your list as
  700.           entries in the format string (i.e. number of
  701.           commas + 1). Empty entries, e.g. with a format
  702.           string of ",,,," are perfectly ok.
  703.  
  704.     The default list format is an empty string (""), this
  705.     means a one column list without special formatting.
  706.  
  707.     BUGS
  708.     Currently there is a maximum of 64 columns for a list.
  709.  
  710.     EXAMPLE
  711.     /* Three column list without further formatting: */
  712.     MUIA_List_Format: ",,"
  713.  
  714.     /* Three column list, middle column centered: */
  715.     MUIA_List_Format: ",P=\33c,"
  716.  
  717.     /* Three column list, display order 2 1 0: */
  718.     MUIA_List_Format: "COL=2,COL=1,COL=0"
  719.  
  720.     /* now something more complex.           */
  721.     /* the display hook defines six entries: */
  722.     dispfunc(_a2 char **array,_a1 struct Article *at)
  723.     {
  724.        *array++ = at->FromName; // col 0
  725.        *array++ = at->FromPath; // col 1
  726.        *array++ = at->ToName;   // col 2
  727.        *array++ = at->ToPath;   // col 3
  728.        *array++ = at->Date;     // col 4
  729.        *array   = at->Subject;  // col 5
  730.     }
  731.  
  732.     /* but we only want to have fromname, date and subject
  733.     /* actually displayed, subject shoud be centered: */
  734.     MUIA_List_Format, "COL=0,COL=4,COL=5 P=\33c"
  735.  
  736.     /* maybe this looks kind of silly, why not make our  */
  737.     /* display hook only fill in these three columns.    */
  738.     /* well, if you would e.g. make the format string    */
  739.     /* user configurable and document what your display  */
  740.     /* hook puts into the array, the user could decide   */
  741.     /* what columns he actually wants to see.            */
  742.     /* The supplied example DFView does something like   */
  743.     /* that.                                             */
  744.  
  745.     /* two column list:   ! Eye    1234 !
  746.                               ! Foot     22 !
  747.                               ! Nose  22331 ! */
  748.  
  749.     MUIA_List_Format, "MAW=100,P=\33r"
  750.  
  751.     SEE ALSO
  752.     MUIA_List_DisplayHook, MUIA_Text_Contents
  753. List.mui/MUIA_List_MultiTestHook
  754.  
  755.     NAME
  756.     MUIA_List_MultiTestHook -- [IS.], struct Hook *
  757.  
  758.     FUNCTION
  759.     If you plan to have a multi selecting list but not
  760.     all of your entries are actually multi selectable
  761.     (e.g. in a file requester), you can supply a
  762.     MUIA_List_MultiTestHook.
  763.  
  764.     It will be called with a pointer to an entry in
  765.     A1 and should return TRUE if the entry is multi
  766.     selectable, FALSE otherwise.
  767.  
  768.     EXAMPLE
  769.     /* multi test func for a list of file info blocks */
  770.  
  771.     LONG __asm mtfunc(_a1 struct FileInfoBlock *fib)
  772.     {
  773.        if (fib->fib_DirEntryType<0)
  774.           return(TRUE);
  775.        else
  776.           return(FALSE);
  777.     }
  778.  
  779.     SEE ALSO
  780.     MUIA_List_ConstructHook, MUIA_List_DestructHook
  781. List.mui/MUIA_List_Quiet
  782.  
  783.     NAME
  784.     MUIA_List_Quiet -- [.S.], BOOL
  785.  
  786.     FUNCTION
  787.     If you add/remove lots of entries to/from a currently visible
  788.     list, this will cause lots of screen action and slow down
  789.     the operation. Setting MUIA_List_Quiet to true will
  790.     temporarily prevent the list from being refreshed, this
  791.     refresh will take place only once when you set it back
  792.     to false again.
  793.  
  794.     EXAMPLE
  795.     set(list,MUIA_List_Quiet,TRUE);
  796.     AddThousandEntries(list);
  797.     set(list,MUIA_List_Quiet,FALSE);
  798.  
  799.     SEE ALSO
  800.     MUIM_List_Insert, MUIM_List_Remove
  801. List.mui/MUIA_List_SourceArray
  802.  
  803.     NAME
  804.     MUIA_List_SourceArray -- [I..], APTR
  805.  
  806.     FUNCTION
  807.     The NULL terminated array given here is immediately inserted into the
  808.     list after object creation time.
  809.  
  810.     EXAMPLE
  811.     static const char *KeyList[] =
  812.     {
  813.        "Cursor Up",
  814.        "Cursor Down",
  815.        "Cursor Left",
  816.        "Cursor Right",
  817.        NULL;
  818.     };
  819.  
  820.     LV_Keys = ListviewObject,
  821.        MUIA_Listview_List, ListObject,
  822.           InputListFrame,
  823.           MUIA_List_AdjustWidth, TRUE,
  824.           MUIA_List_SourceArray, KeyList,
  825.           End,
  826.        End;
  827. List.mui/MUIA_List_Title
  828.  
  829.     NAME
  830.     MUIA_List_Title -- [ISG], char *
  831.  
  832.     FUNCTION
  833.     Specify a title for the current list. The title is displayed
  834.     at the very first line and doesn't scroll away when the list
  835.     top position moves.
  836.  
  837.     Usually, the title is just a string. However, if you have
  838.     a multi column list with a custom display hook and you
  839.     want to have seperate titles for each of your columns,
  840.     you can set this attribute to TRUE. In this case, whenever
  841.     MUI feels that the list title has to be drawn, it will
  842.     call your display hook with a NULL entry pointer. Your
  843.     hook has to check for this NULL entry and fill the
  844.     given string array with your column titles. Layout of
  845.     the column titles follows the same rules as layout
  846.     of the lists entries.
  847.  
  848.     EXAMPLE
  849.  
  850.     /* display function for a multi columned file list with titles */
  851.  
  852.     LONG __asm DisplayFunc(_a2 char **array,_a1 struct Entry *e)
  853.     {
  854.        struct Data *data = hook->h_Data;
  855.  
  856.        if (e)
  857.        {
  858.           *array++ = e->Name;
  859.           *array++ = e->Size;
  860.           *array++ = e->Date;
  861.           *array++ = e->Time;
  862.           *array++ = e->Flags;
  863.           *array   = e->Comment;
  864.        }
  865.        else
  866.        {
  867.           *array++ = "Name";
  868.           *array++ = "Size";
  869.           *array++ = "Date";
  870.           *array++ = "Time";
  871.           *array++ = "Flags";
  872.           *array   = "Comment";
  873.        }
  874.  
  875.        return(0);
  876.     }
  877.  
  878.     SEE ALSO
  879.     MUIA_List_DisplayHook
  880. List.mui/MUIA_List_Visible
  881.  
  882.     NAME
  883.     MUIA_List_Visible -- [..G], LONG
  884.  
  885.     FUNCTION
  886.     Get the current number of visible entries in the list.
  887.     You have to be prepared to get a result
  888.     of -1, which means that the list is not visible
  889.     at all (e.g. when the window is iconifed).
  890.  
  891.     SEE ALSO
  892.     MUIA_List_First, MUIA_List_Entries, MUIA_List_Active
  893.